
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="" autocomplete="off">
    <input class="form-control" name="row[is_chat]" type="hidden" value="0">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2"><span style="color:red;">*</span>{:__('课程编码')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-number" data-rule="required" class="form-control" name="row[number]" type="text" value="{$row.number|htmlentities}" maxlength="6"><span>课程编码为6位</span>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2"><span style="color:red;">*</span>{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2"><span style="color:red;">*</span>{:__('主讲老师')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-teacher_id" data-rule="required" data-source="learn/teacher/index" class="form-control selectpage" name="row[teacher_id]" type="text" value="{$row.teacher_id|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Introduce')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-introduce" class="form-control" name="row[introduce]" type="text" value="{$row.introduce|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('课程积分')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-source" class="form-control" name="row[source]" type="number" value="{$row.source|htmlentities}" onmousewheel="return false;" onDOMMouseScroll="stopScrollFun">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2"><span style="color:red;">*</span>{:__('上传课程')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-file" data-rule="required" class="form-control" size="5120" name="row[file]" type="text" value="{$row.file|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-vediofile" class="btn btn-danger plupload" data-input-id="c-file" data-mimetype="mp4,avi,flv,wmv,mp3" data-multiple="false" data-maxsize="5120M" data-multipart={"controller":"{$controller}.movie"}><i class="fa fa-upload" data-preview-id="p-file"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-vediofile" class="btn btn-primary fachoose" data-input-id="c-file" data-mimetype="mp4,avi,flv,wmv,mp3" data-multiple="false" data-multipart="{$controller}.movie"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-file"></span>
            </div>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Origin_price')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-origin_price"  class="form-control" step="0.01" name="row[origin_price]" type="number" value="{$row.origin_price|htmlentities}" onmousewheel="return false;" onDOMMouseScroll="stopScrollFun">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Price')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-price"  class="form-control" step="0.01" name="row[price]" type="number" value="{$row.price|htmlentities}" onmousewheel="return false;" onDOMMouseScroll="stopScrollFun">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Visitor_origin_price')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-visitor_origin_price" class="form-control" step="0.01" name="row[visitor_origin_price]" type="number" value="{$row.visitor_origin_price|htmlentities}" onmousewheel="return false;" onDOMMouseScroll="stopScrollFun">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Visitor_price')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-visitor_price" class="form-control" step="0.01" name="row[visitor_price]" type="number" value="{$row.visitor_price|htmlentities}" onmousewheel="return false;" onDOMMouseScroll="stopScrollFun">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-image" class="form-control" size="50" data-maxcount="1" name="row[image]" type="text" value="{$row.image|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-image" class="btn btn-danger plupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-image"  data-multipart={"controller":"{$controller}"} ><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false" data-multipart="{$controller}"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-image"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-image"></ul>
        </div>
    </div>
    <!--<div class="form-group">-->
        <!--<label for="c-images" class="control-label col-xs-12 col-sm-2">{:__('Images')}:</label>-->
        <!--<div class="col-xs-12 col-sm-8">-->
            <!--<div class="input-group">-->
                <!--<input id="c-images" class="form-control" size="50" name="row[images]" type="text" value="{$row.images|htmlentities}" />-->
                <!--<div class="input-group-addon no-border no-padding">-->
                    <!--<span><button type="button" id="plupload-imagethumb" class="btn btn-danger plupload" data-input-id="c-images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/webp" data-multiple="true" data-preview-id="p-images" data-multipart={"controller":"{$controller}"}><i class="fa fa-upload"></i>{:__('Upload')}</button></span>-->
                    <!--<span><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-images" data-mimetype="image/*" data-multiple="true" data-multipart="{$controller}"><i class="fa fa-list"></i> {:__('Choose')}</button></span>-->
                <!--</div>-->
                <!--<span class="msg-box n-right"></span>-->
            <!--</div>-->
            <!--<ul class="row list-inline plupload-preview" id="p-images"></ul>-->
        <!--</div>-->
    <!--</div>-->

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea  id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50" >{$row.content|htmlentities}</textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('分类')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="col-xs-12 col-sm-8">
                <div class="checkbox">
                    <div style="display: inline-block;">
                        <label for="row[learn_cate_ids]-1"  style="float: left;margin-top: 6px;"><input id="row[learn_cate_ids]-1" name="row[learn_cate_ids][]" type="checkbox" value="1" onclick="change_select(this, 'one')" {if  in_array(1, $learn_cate_ids)  }checked {/if}> 家长 -</label>
                        <div class="type_one"  style="float: left;padding-left: 10px;">
                            {:build_checkboxs('row[type1][]', ['1'=>__('幼儿课程'), '2'=>__('小学课程'), '3'=>__('初中课程'), '4'=>__('高中课程')], $type_arr['type1'])}
                        </div>
                    </div>
                    <div style="display: inline-block;">
                        <label for="row[learn_cate_ids]-2"  style="float: left;margin-top: 6px;"><input id="row[learn_cate_ids]-2" name="row[learn_cate_ids][]" type="checkbox" value="2" onclick="change_select(this, 'two')"  {if  in_array(2, $learn_cate_ids)  }checked {/if}> 学生 -</label>
                        <div  class="type_two" style="float: left;padding-left: 10px;">
                            {:build_checkboxs('row[type2][]', ['1'=>__('幼儿课程'), '2'=>__('小学课程'), '3'=>__('初中课程'), '4'=>__('高中课程')], $type_arr['type2'])}
                        </div>
                    </div>
                    <div style="display: inline-block;">
                        <label for="row[learn_cate_ids]-3"  style="float: left;margin-top: 6px;"><input id="row[learn_cate_ids]-3" name="row[learn_cate_ids][]" type="checkbox" value="3" onclick="change_select(this, 'thr')"   {if  in_array(3, $learn_cate_ids)  }checked {/if}> 教职 -</label>
                        <div  class="type_thr" style="float: left;padding-left: 10px;">
                            {:build_checkboxs('row[type3][]', ['1'=>__('幼儿课程'), '2'=>__('小学课程'), '3'=>__('初中课程'), '4'=>__('高中课程')], $type_arr['type3'])}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('专题')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_checkboxs('row[learn_special_ids][]', $specialdata, $learn_special_ids)}
        </div>
    </div>
    {if condition="$org_cate_id eq 0"}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('是否大咖课程')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="radio">
                <label for="row[special]-1"><input id="row[special]-1" name="row[special]" type="radio" value="1" {if $row.special == 1} checked {/if} />否</label>
                <label for="row[special]-2"><input id="row[special]-2" name="row[special]" type="radio" value="2" {if $row.special == 2} checked {/if}/>是</label>
            </div>
        </div>
    </div>
    {else/}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2"><span style="color:red;">*</span>{:__('是否大咖课程')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="radio">
                <label for="row[special]-1"><input id="row[special]-1" name="row[special]" type="radio" value="1" checked="checked" /> 否</label>
            </div>
        </div>
    </div>
    {/if}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('是否热门课程')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="radio">
                <label for="row[is_hot]-1"><input id="row[is_hot]-1" name="row[is_hot]" type="radio" value="1" {if $row.is_hot == 1} checked {/if} />否</label>
                <label for="row[is_hot]-2"><input id="row[is_hot]-2" name="row[is_hot]" type="radio" value="2" {if $row.is_hot == 2} checked {/if}/>是</label>
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('是否单卖')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="radio">
                <label for="is_single-1"><input class="form-input-type" id="is_single-1" name="row[is_single]" type="radio" value="1" {if $row.is_single == 1} checked {/if}> 允许</label>
                <label for="is_single-2"><input class="form-input-type"  id="is_single-2" name="row[is_single]" type="radio" value="2" {if $row.is_single == 2} checked {/if}> 不允许</label>
            </div>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            
            <div class="radio">
            {foreach name="statusList" item="vo"}
            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label> 
            {/foreach}
            </div>

        </div>
    </div>
    <!--<div class="form-group">-->
        <!--<label class="control-label col-xs-12 col-sm-2"><span style="color:red;">*</span>{:__('Org_cate_id')}:</label>-->
        <!--<div class="col-xs-12 col-sm-8">-->
            <!--<input id="c-org_cate_id" data-source="org/cate/index" class="form-control selectpage" name="row[org_cate_id]" type="text" value="{$row.org_cate_id|htmlentities}">-->
        <!--</div>-->
    <!--</div>-->
    <!--<div class="form-group">-->
        <!--<label class="control-label col-xs-12 col-sm-2"><span style="color:red;">*</span>{:__('Is_buy')}:</label>-->
        <!--<div class="col-xs-12 col-sm-8">-->
                        <!---->
            <!--<select  id="c-is_buy" data-rule="required" class="form-control selectpicker" name="row[is_buy]">-->
                <!--{foreach name="isBuyList" item="vo"}-->
                    <!--<option value="{$key}" {in name="key" value="$row.is_buy"}selected{/in}>{$vo}</option>-->
                <!--{/foreach}-->
            <!--</select>-->

        <!--</div>-->
    <!--</div>-->
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
<script>
    function change_select(obj, type)
    {
        var check  = $(obj).prop('checked');
        if(check){
            $('.type_'+type).show();
        }else{
            $('.type_'+type).hide();
        }

    }
</script>

<script>
    function stopScrollFun(evt) {
        evt = evt || window.event;
        if(evt.preventDefault) {
            // Firefox
            evt.preventDefault();
            evt.stopPropagation();
        } else {
            // IE
            evt.cancelBubble=true;
            evt.returnValue = false;
        }
        return false;
    }
</script>